{"ast":null,"code":"import * as React from 'react';\nexport default function useLazyKVMap(data, childrenColumnName, getRowKey) {\n  var mapCacheRef = React.useRef({});\n  function getRecordByKey(key) {\n    if (!mapCacheRef.current || mapCacheRef.current.data !== data || mapCacheRef.current.childrenColumnName !== childrenColumnName || mapCacheRef.current.getRowKey !== getRowKey) {\n      /* eslint-disable no-inner-declarations */var dig = function dig(records) {\n        records.forEach(function (record, index) {\n          var rowKey = getRowKey(record, index);\n          kvMap.set(rowKey, record);\n          if (record && typeof record === 'object' && childrenColumnName in record) {\n            dig(record[childrenColumnName] || []);\n          }\n        });\n      }; /* eslint-enable */\n      var kvMap = new Map();\n      dig(data);\n      mapCacheRef.current = {\n        data: data,\n        childrenColumnName: childrenColumnName,\n        kvMap: kvMap,\n        getRowKey: getRowKey\n      };\n    }\n    return mapCacheRef.current.kvMap.get(key);\n  }\n  return [getRecordByKey];\n}","map":{"version":3,"names":["React","useLazyKVMap","data","childrenColumnName","getRowKey","mapCacheRef","useRef","getRecordByKey","key","current","dig","records","forEach","record","index","rowKey","kvMap","set","Map","get"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/table/hooks/useLazyKVMap.js"],"sourcesContent":["import * as React from 'react';\nexport default function useLazyKVMap(data, childrenColumnName, getRowKey) {\n  const mapCacheRef = React.useRef({});\n  function getRecordByKey(key) {\n    if (!mapCacheRef.current || mapCacheRef.current.data !== data || mapCacheRef.current.childrenColumnName !== childrenColumnName || mapCacheRef.current.getRowKey !== getRowKey) {\n      const kvMap = new Map();\n      /* eslint-disable no-inner-declarations */\n      function dig(records) {\n        records.forEach((record, index) => {\n          const rowKey = getRowKey(record, index);\n          kvMap.set(rowKey, record);\n          if (record && typeof record === 'object' && childrenColumnName in record) {\n            dig(record[childrenColumnName] || []);\n          }\n        });\n      }\n      /* eslint-enable */\n      dig(data);\n      mapCacheRef.current = {\n        data,\n        childrenColumnName,\n        kvMap,\n        getRowKey\n      };\n    }\n    return mapCacheRef.current.kvMap.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